package com.zzc.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.zzc.pojo.GoIn;
import com.zzc.pojo.Storage;
@Repository("goindao")
public class GoInDao extends BaseDaoImpl<GoIn>{
	public StorageDao sd;
	public Storage findStorageByPid(Integer pid){
		String hql="from GoIn g where g.pid=?";
		List<GoIn> list=(List<GoIn>)this.getHibernateTemplate().find(hql,pid);
		if(list.size()>0){
			GoIn goin=list.get(0);
			Integer sid=goin.getSid();
			Storage storage=sd.findBySid(sid);
			return storage;
		}else{
			return null;
		}
	}
}
